import java.util.*;
public class Main{
    public static void main(String[]args){
        Scanner scan=new Scanner(System.in);
        String str1=scan.nextLine();
        String str2=scan.nextLine();
        int count=0;
        for(int i=0;i<=str1.length();i++){
            StringBuilder str=new StringBuilder(str1);
            str.insert(i,str2);
            StringBuilder tmp=new StringBuilder(str);
            StringBuilder str3=tmp.reverse();
            if(str.toString().equals(str3.toString())){
                count++;
            }
        }
        System.out.println(count);
    }
}
